import json



# a = {
# "employees": [
# { "firstName":3 , "lastName":"Gates" },
# { "firstName":"George" , "lastName":"Bush" },
# { "firstName":"Thomas" , "lastName":"Carter" }
# ]
# }
#
# b = json.dumps(a)
# print(type(a))
# print(b)
# print(b[5])

# a = '{"data":"","info":"%E6%9D%8E%E7%8B%97%E5%97%A8","status":1}'
# b = json.loads(a)
# # print(json.loads(a))
# print(type(a))
# print(type(b))
from urllib import parse
import urllib
body = 'forward=&step=2&regname=test_2&regpwd=test_2&regpwdrepeat=test_2&regemail=648772275%40qq.com&rgpermit=1'
body = urllib.parse.unquote(body)
spl = body.split('&')
data = {}
for i in spl:
    sp = i.split('=')
    data.update({sp[0]:sp[1]})
print(data)


# def change_string(String):
#     str1 = String.split('&')
#     dic = {}
#     print(str1)
#     for i in str1:
#         a = i.index('=')
#         c = i[0:a]
#         d = i[a+1:len(i)]
#         c = ''.join(c)
#         d = ''.join(d)
#         dic.update({c:d})
#     return dic
# print(change_string(body))